Add error if inputting from a style file without IFIELDs.
authorrobertl <robertl>
Thu, 19 Jul 2007 16:39:59 +0000 (16:39 +0000)
committerrobertl <robertl>
Thu, 19 Jul 2007 16:39:59 +0000 (16:39 +0000)
csv_util.c

index a5d52ffe7f52f22b8a1439781f2b1e2b0e940a27..81b833b76a6c54ec1ff7cc233cc78613cb55d60d 100644 (file)
@@ -1091,6 +1091,10 @@ xcsv_data_read(void)
             s = buff;
             s = csv_lineparse(s, xcsv_file.field_delimiter, "", linecount);
 
+           if (QUEUE_EMPTY(&xcsv_file.ifield)) {
+               fatal(MYNAME ": attempt to read, but style '%s' has no IFIELDs in it.\n", xcsv_file.description? xcsv_file.description : "unknown");
+           }
+
             /* reset the ifield queue */
             elem = QUEUE_FIRST(&xcsv_file.ifield);